<?php
//=======================================
//###################################
// Kayako Web Solutions
//
// Source Copyright 2001-2004 Kayako Infotech Ltd.
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2005/08/07 05:20:29 $)
// $RCSfile: setup_step5.php,v $ : $Revision: 1.4 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//###################################
//=======================================


if (!defined("INSWIFT")) {
	// File being called directly, end it
	trigger_error("Unable to process $PHP_SELF", E_USER_ERROR);
}

displayHeader();

if ($dbCore->connected)
{
	require_once ("./includes/functions_template.php");

	// Import the templates
	$result = importTemplateFromFile(dirname(__FILE__)."/../includes/swift.templates.xml", 1, false);
	if (!$result)
	{
		trigger_error("ERROR: Could not insert all templates. $sqlcount - $insertedchunks", E_USER_ERROR);		
	}

	foreach ($result["categorylist"] as $key=>$val)
	{
		displayStatus("Creating Template Category: ".$val, true);
	}

	foreach ($result["templatelist"] as $key=>$val)
	{
		displayStatus("Inserting Template: ".$val, true);
	}

} else {
	$_SWIFT["error"] = true;
}
displayFooter();
?>